﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ReallyReallyReallySimpleRoguelike.Managers;

namespace ReallyReallyReallySimpleRoguelike.Screens
{
    class QuitScreen:Screen
    {

        public QuitScreen()
        { 
            
        }

        public override void Show()
        {
            Console.Clear();
            
            Console.ForegroundColor = ConsoleColor.White;
            
            Console.WriteLine("Are you sure you wish to quit (y or n) ?");
           
            ConsoleKey quit = Console.ReadKey(true).Key;
            if (quit.Equals(ConsoleKey.Y))
            {
                DungeonManager.Instance.gameOver = true;
                Console.WriteLine("See you later!");
                Console.ReadKey(true);
                GameManager.Instance.creditScreen.Show();
                Environment.Exit(0);
            }
            else
            {
                Console.WriteLine("Keep playing");

                DungeonManager.Instance.ForceRedraw();
            }
            DungeonManager.Instance.PlaySound(SoundList.Pluck);
        }
    }
}
